\documentclass[10pt]{article}

\usepackage[utf8]{inputenc}

\usepackage{tabularx}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{geometry}
\geometry{a4paper, top=25mm, left=30mm, right=25mm, bottom=30mm,
         headsep=10mm, footskip=12mm}

\usepackage{graphicx}
\usepackage{url}
\usepackage[pdftex,colorlinks=true,citecolor=blue,urlcolor=blue,linkcolor=blue]{hyperref}
\usepackage{color}
\usepackage{xcolor}
\usepackage{tabularx}
\usepackage{listings}
\usepackage{parcolumns}
\usepackage{longtable}
\usepackage[margin=10pt]{caption}

% set the title
\title{\begin{tabular}{p{11cm}}\centering
Machine Learning with OpenCV2
\end{tabular}}

% contact details
\author{Philipp Wagner\\\href{http://www.bytefish.de}{http://www.bytefish.de}}

% colors for syntax highlightning
\definecolor{darkblue}{rgb}{0,0,.6}
\definecolor{darkred}{rgb}{.6,0,0}
\definecolor{darkgreen}{rgb}{0,.6,0}
\definecolor{red}{rgb}{.98,0,0}


% Listings Style
\lstset{
	numberstyle=\footnotesize, 
	basicstyle=\footnotesize\ttfamily
	numbers=left, 
	numbersep=5pt, 
	frame=single
}

% Add basic syntax highlightning to C++
\lstset{
	numberstyle=\footnotesize, 
	basicstyle=\footnotesize\ttfamily,
	numbers=none, 
	numbersep=5pt, 
	frame=single,
	breaklines=true,
	showspaces=false,
	showstringspaces=false,
	showtabs=false,
	tabsize=2,
}

\lstloadlanguages{C++}
\lstset{
	language=C++,
  commentstyle=\footnotesize\ttfamily\color{darkgreen},
  keywordstyle=\footnotesize\ttfamily\color{darkblue},
  stringstyle=\footnotesize\ttfamily\color{darkred},
}

\lstdefinelanguage{cmake}{
	morekeywords={cmake_minimum_required, project, find\_package, add\_executable, target\_link\_libraries},
	sensitive=false,
	morecomment=[l]{\#},
}

% change vertical space of itemize, description and enumeration environments
\let\olditemize=\itemize
   \def\itemize{\olditemize\setlength{\itemsep}{-0.5ex}}
\let\oldenumerate=\enumerate
   \def\enumerate{\oldenumerate\setlength{\itemsep}{-0.5ex}}
\let\olddescription=\description
   \def\description{\olddescription\setlength{\itemsep}{-0.5ex}}
   
% don't indent sections
\setlength{\parindent}{0pt}

\begin{document}

\maketitle
\tableofcontents

% include sections
\input{section/introduction.tex}
\input{section/installation.tex}
\input{section/data.tex}
\input{section/svm.tex}
\input{section/mlp.tex}
\input{section/evaluation.tex}

\appendix

\section{main.cpp}
\lstinputlisting[language=C++, caption=main.cpp]{../main.cpp}

% bibliography
\bibliography{bib/machinelearning}
\bibliographystyle{acm}

\end{document}
